<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
		<meta name="format-detection" content="telephone=no">
		<meta name="applicable-device" content="mobile">
		<title>大件会</title>
		<link rel="stylesheet" type="text/css" href="../lib/layer/theme/default/layer.css">
		<link rel="stylesheet" type="text/css" href="../css/common.css">
		<link rel="stylesheet" type="text/css" href="../css/activity.css">
		<style>
			/* 提示框 */

			.tip {
				display: none;
				padding: 10px 30px;
				border-radius: 5px;
				background-color: rgba(0, 0, 0, 0.6);
				position: fixed;
				top: 16%;
				left: 50%;
				transform: translateX(-50%);
				color: #fff;
			}
		</style>
	</head>

	<body>
		<div class="homeContainer">
			<div class="homeContent">
				<div class="saveText">
					<img src="../images/activity/slogan_.png" alt="">
				</div>
				<div class="proName">维达emoji限量版手帕纸</div>
				<div class="lxChange">
					<div class="isOpenGroup">
						<div class="redBtn" id="getPaper">我要手帕纸</div>
						<div class="btnLogin wbox">
							<a class="gray giveUp">算了，不参加</a>
							<a class="invite wfl">邀请好友助力</a>
							<a class="hasGroup"></a>
						</div>
					</div>
					<div class="opreateArea">
						<div class="personNumber">
							<div class="portrict">
								<div>
									<!-- <img src="../images/activity/header_o.png" alt="">
								<img src="../images/activity/wenhaotouxiang.png" alt="">
								<img src="../images/activity/wenhaotouxiang.png" alt=""> -->
								</div>
							</div>
							<div class="surplus">剩余助力
								<span class="leavePerson">2</span> 人</div>
						</div>
						<div class="zhuliBtn">
							<button class="btn zhuliBtnIn">帮他一把</button>
							<button class="btnGray"></button>
						</div>
					</div>
				</div>
				<div class="activeRules">
					<div class="title">
						<img src="../images/activity/activity_.png" alt="">
					</div>
					<div class="rule">
						<div>① 点击“我要手帕纸”并邀请2位好友帮忙助力，助力完成后关注“郑州大件会”公众号，回复“维达”关键字，即可免费邮寄到家</div>
						<div>② 每人仅可开团、助力1次；仅限1000条，送完为止</div>
						<div>③ 活动时间：即日起-2018年4月30日</div>
						<div>④ 仅限郑州市区（含郊县）参与</div>
					</div>
				</div>
				<!-- 不要 -->
				<!-- <div class="test1"></div> -->

				<div class="activeRules forward">
					<div class="title">
						<img src="../images/activity/prize_.png" alt="">
					</div>
					<div class="rule">
						<div>① 活动商品：维达限量版emoji手帕纸1条</div>
						<div>② 商品规格：1条共10包，3层、8张/包，210mm*210mm，自然无香</div>
					</div>
				</div>
			</div>
			<!--分享-->
			<div class="homeShare">
				<img src="../images/share/share_.png" onclick="closeModel();" />
				<img src="../images/share/i_know.png" class="close" onclick="closeModel();" />
			</div>
			<div class="tip"></div>
			<!-- <a class="closeWeb"></a> -->

		</div>
	</body>
	<script src="../js/jquery-1.11.3.js"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script src="../lib/layer/layer.js"></script>
	<script src="../js/ajax.js"></script>
	<script src="../js/prompt.js"></script>
	<script src="../js/share.js"></script>
	<script type="text/javascript">
		/* 从连接规定运营发出的链接参数带spread=其它表开团，spread=0表示助力(或说推广id) */
		//假设开团
		var ajaxStatus = true;
		$(function () {
			var isopenPage = getParam('isopenPage');	//开团页面与分享页面区分参数
			var initiatorId = getParam('initiatorId');	//开团id
			var spreadId = getParam('spreadId')	//推广id
			// alert('推广id'+ spreadId)	//页面互传参数
			var fromId = {}
			fromId.isopenPage = isopenPage || '';
			fromId.initiatorId = initiatorId || '';
			fromId.spreadId = spreadId || ''
			// alert(fromId.spreadId)
			localStorage.setItem("fromId", JSON.stringify(fromId));
			/*微信授权*/
			//开发环境

			/* 	var appid = "wx70b168bc0e5fc510";
				var fromurl = 'http://m.wh71.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent47.dajianhui.com/pages/lxIndex.html?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
				var ShareUrl = 'http://m.wh71.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent47.dajianhui.com/pages/lxIndex.html?isopenPage=0?same=1?initiatorId=' + initiatorId + '?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
				var loUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(fromurl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
				var ShareloUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(ShareUrl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
			 */

			//测试环境
			var appid = "wxdc3cc9560b9cde9d";
			var fromurl = 'http://m.wh.cs.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent.cs.dajianhui.com/pages/lxIndex.html?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
			var ShareUrl = 'http://m.wh.cs.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent.cs.dajianhui.com/pages/lxIndex.html?isopenPage=0?same=1?initiatorId=' + initiatorId + '?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页

			var loUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(fromurl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
			var ShareloUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(ShareUrl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';

			//预发布环境
			/* 	var appid = "wx70b168bc0e5fc510";
				var fromurl = 'http://m.wh71.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent71.dajianhui.com/pages/lxIndex.html?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
				var ShareUrl = 'http://m.wh71.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent71.dajianhui.com/pages/lxIndex.html?isopenPage=0?same=1?initiatorId=' + initiatorId + '?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
				var loUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(fromurl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
				var ShareloUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(ShareUrl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
			 */
			//正式环境
			/* 	var appid = "wx0fa3e8e1b9b1ef95";
				var fromurl = 'http://m.wh.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent.dajianhui.com/pages/lxIndex.html?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
				var ShareUrl = 'http://m.wh.dajianhui.com/wx/wxCallback?wxCallback=http://zjevent.dajianhui.com/pages/lxIndex.html?isopenPage=0?same=1?initiatorId=' + initiatorId + '?spreadId=' + spreadId; //获取授权code的回调地址，获取到code，直接返回到当前页
				var loUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(fromurl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
				var ShareloUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(ShareUrl) + '&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect';
			 */
			// alert('当前链接:'+ window.location.href)
			var code = '';
			/* code = '081ni0Ay0m45Of1sMDAy0CjSzy0ni0Am';
			doMain(code) */
			//授权 获取code
			var same = getParam('same');
			if (isopenPage == 0) { //分享 
				if (same == 1) {
					code = getParam('code');
					// alert('分享：' + code);
					if (code) {
						doMain(code);
					} else {
						// alert('助力关闭微信浏览器')
						WeixinJSBridge.call('closeWindow');
					}
				} else {
					window.location.href = ShareloUrl;
				}
			} else {//正常
				code = getParam('code');
				// alert('正常' + code);
				if (code) {
					// $('.test1').html(code)
					doMain(code);
				}
				else if (!code) {
					window.location.href = loUrl
				} else {
					// alert('开团关闭微信浏览器')
					WeixinJSBridge.call('closeWindow');
				}
			}
			//业务逻辑
			/* ***测试 */
			// whether4('<div class="title">很遗憾！您与“维达Emoji限量版手帕纸”活动仅差一个手指的距离</div>', '我知道了')
			var type = 'post'
			var dataType = 'json'
			function doMain(code) {
				if (code) {
					/* alert(JSON.stringify({
						code: code,
						source: 3}))
						alert(url) */
					// 5.4整码
					//微信登录请求
					var loginParams = {
						code: code, //微信授权code
						source: 3
					};
					$('.test1').html(code)
					var urlWxlogin = url + "/api/third/wxlogin";
					post(urlWxlogin, loginParams, sucWxlogin, true, type, dataType, errWxlogin);
					function sucWxlogin(data) {
						// alert(JSON.stringify(data))
						var code = data.code;
						if (code == 200) {
							// alert(data.msg);
							var obj = JSON.stringify(data.obj);
							// alert('obj' + obj);
							localStorage.setItem('userinfo', obj);
							localStorage.setItem('isbind', data.obj.isBind);
							localStorage.setItem('token', data.obj.token);
							var tokenPass = data.obj.token;
							/* 下面代码要放进授权允许后 */
							// alert(isopenPage)
							//开团页面进入
							if (isopenPage != 0) {
								// alert("开团")
								/*授权登录后，将个人信息存储本地*/
								var userinfo = JSON.parse(localStorage.getItem('userinfo'));
								var isBind = localStorage.getItem('isbind');
								var token = localStorage.getItem("token");
								var openGroupId = ''
								//判断是否已经成团,是否跳转关注页面
								var isktdatas = {
									// token: '476230e27386384bb5330f9cc96eaaaa',//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
									token: token,//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
									loginType: 51,//userinfo.loginType 50-本地会员,51-第三方微信登录,52-第三方QQ登录
								}
								whether4("<img src='../images/activity/celebrate.png'/><div class='title'>恭喜您!也获得手帕纸一条，仅需<span class='numP'>2</span>位好友助力就能免费邮寄到家啦！</div>", "我知道了")
								// 成团后跳转attention页面
								// alert('有无成团参数'+JSON.stringify(isktdatas))
								//有无成团判断请求
								var urlIsSuccessGroup = url + "/api/activity/initiator/isSuccessGroup";
								post(urlIsSuccessGroup, isktdatas, sucIsSuccessGroup, false, type, dataType);
								function sucIsSuccessGroup(res) {
									// alert('有无成团:' + JSON.stringify(res))
									if (res.code == 200) {
										if (res.obj.isSuccessGroup == 0) {
										} else {
											// isGroup = true
											window.location.href = './attention.html';
										}
									}
								}

								//是否已开团，是否跳转奖励页面
								var urlIsOpenGroup = url + "/api/activity/initiator/isOpenGroup";
								post(urlIsOpenGroup, isktdatas, sucIsOpenGroup, false, type, dataType);
								function sucIsOpenGroup(data) {
									// alert('已开团:' + JSON.stringify(data))
									if (data.code == 200) {
										var isOpenGroup = data.obj.isOpenGroup;
										// alert('isOpenGroup:' + JSON.stringify(isOpenGroup));
										// alert("团长id:" + data.obj.initiatorId)
										if (isOpenGroup == 1) {//0没有开团  1 已经开团
											openGroupId = data.obj.initiatorId
											window.location.href = '../pages/reward.html?isopenPage=' + isopenPage + '&openGroupId=' + openGroupId + '&token=' + tokenPass + '&spreadId=' + spreadId
											// whether4('<div class="title">您已开过团，不能再继续开团啦</div>', '我知道了')
											$('#getPaper').hide();
											$('.btnLogin').css('display', '-webkit-box');
										}
									}
								}
								//点击我要纸按钮，时候绑定，能否开团
								$('#getPaper').on('click', function () {
									// alert('绑定' + isBind)
									if (isBind == 'false') {
										window.location.href = 'bindTelN.html';
									} else {
										// whether("<img src='../images/activity/celebrate.png'/><div class='titleH'>助力成功</div><div class='title'>恭喜您也获得手帕纸一条，仅需<span class='numP'>2</span>位好友助力就能免费邮寄到家啦！</div>", "我要参与")
										/* 是否已经开团 */
										// $(".iKnow").on("click", function () {
										var isktdatas = {
											// token: '476230e27386384bb5330f9cc96eaaaa',//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
											token: token,//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
											loginType: 51,//userinfo.loginType 50-本地会员,51-第三方微信登录,52-第三方QQ登录
										}
										//是否已开团，是否跳转奖励页面
										var urlIsOpenGroup = url + "/api/activity/initiator/isOpenGroup";
										post(urlIsOpenGroup, isktdatas, sucIsOpenGroup, false, type, dataType);
										function sucIsOpenGroup(data) {
											alert('是否开团:' + JSON.stringify(data))
											if (data.code == 200) {
												var isOpenGroup = data.obj.isOpenGroup;
												// alert('isOpenGroup:' + JSON.stringify(isOpenGroup));
												// alert("团长id:" + data.obj.initiatorId)
												if (isOpenGroup == 1) {//0没有开团  1 已经开团
													openGroupId = data.obj.initiatorId //开团id
													whether4('<div class="title">您已开过团，不能再继续开团啦</div>', '我知道了')
													$('#getPaper').hide();
													// $('.invite').hide();
													// $(".hasGroup").show();
													// $(".hasGroup").addClass("invite wfl");
													// $(".hasGroup").html("邀请好友助力");
													$('.btnLogin').css('display', '-webkit-box');
												}
												else {
													$('#getPaper').hide();
													$('.btnLogin').css('display', '-webkit-box');
													// whether4("<img src='../images/activity/celebrate.png'/><div class='titleH'>助力成功</div><div class='title'>恭喜您也获得手帕纸一条，仅需<span class='numP'>2</span>位好友助力就能免费邮寄到家啦！</div>", "我要参与")
													// isktdatas.from = isopenPage
													isktdatas.from = spreadId
													// alert(JSON.stringify(isktdatas))
													// alert('新团添加推广id'+spreadId)
													// isktdatas.from = 1 //推广id
													var urlAdd = url + "/api/activity/initiator/add";
													post(urlAdd, isktdatas, sucAdd, false, type, dataType);
													function sucAdd(res) {
														// alert('新开团' + JSON.stringify(res))
														if (res.code == 200) {
															openGroupId = res.obj.initiatorId;
															fromId.initiatorId = res.obj.initiatorId 	//开团id
														}
													}
												}
											}
										}

									}
									/*判断用户*/
								})

								/*邀请好友助力,分享好友*/
								$('.invite').on('click', function () {
									$('.homeShare').show();
									var signUrl = window.location.href.split('#')
									// var signUrl2 = signUrl + '?isopenPage=0&initiatorId=' + openGroupId;
									// alert(signUrl);
									var signUrl2 = signUrl + '&isopenPage=0&initiatorId=' + openGroupId + '&spreadId=' + spreadId;
									// alert(signUrl2)
									console.log('signUrl是' + signUrl)
									var urlSdk = url + "/api/js/sdk";
									var sdkParams = { signUrl: encodeURIComponent(signUrl) }
									post(urlSdk, sdkParams, sucSdk, true, type, dataType, errSdk);
									function sucSdk(data) {
										var code = data.code;
										var jsSdk = data.obj.jsSdk;
										/*var  shareurl = jsSdk.url;*/
										// alert('分享接口参数'+JSON.stringify(data))
										if (code == 200) {
											// alert('jsSdk' + JSON.stringify(jsSdk))
											share(jsSdk, signUrl2, '100%可得维达Emoji限量版手帕纸免费送', '100%可得维达Emoji限量版手帕纸免费送', 'http://zjevent47.dajianhui.com/images/dajianLogo.png', isopenPage, openGroupId, tokenPass, spreadId);
											//测试用跳转
											window.location.href = '../pages/reward.html?isopenPage=' + isopenPage + '&openGroupId=' + openGroupId
										}
									}
									function errSdk(data) {
										alert('分享失败');
									}
								})
								//算了我不参加
								$('.giveUp').on('click', function () {
									whether4('<div class="title">很遗憾！您与“维达Emoji限量版手帕纸”活动仅差一个手指的距离</div>', '我知道了')
									$('#getPaper').show();
									$('.btnLogin').css('display', 'none');

								})
							}
							/* 下面代码要放进授权允许后 */

							/*中间块随开团或助力展示  */

							if (isopenPage == 0) {

								$(".opreateArea").css("display", "block");
								$(".isOpenGroup").css("display", "none");

							} else {
								$(".isOpenGroup").css("display", "block");
								$(".opreateArea").css("display", "none");
							}
							//助力页面进入

							if (isopenPage == 0) {
								// alert("分享")
								// alert("fenxiang2:"+isopenPage)
								/* 助力人列表信息 */
								var token = localStorage.getItem("token");
								// var initiatorId = window.location.href.split("=") //开团id
								var zlListParams = {
									// token: '476230e27386384bb5330f9cc96eaaaa',//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
									token: token,//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
									// token: "e16c3c89852fd4b759becaf47f319033",//userinfo.token'476230e27386384bb5330f9cc96eaaaa'
									loginType: 51,//userinfo.loginType 50-本地会员,51-第三方微信登录,52-第三方QQ登录
									// initiatorId: 11 //从分享链接获取
									initiatorId: initiatorId //从分享链接获取
								}
								// alert('助力参数' + JSON.stringify(zlListParams))
								//用于新用户点击帮他一把弹窗的数字
								var needPerson = '';
								var urlHelpList = url + "/api/activity/help/helpList";
								post(urlHelpList, zlListParams, sucHelpList, true, type, dataType);
								function sucHelpList(res) {
									alert('助力人员' + JSON.stringify(res))
									if (res.code == 200) {
										// alert('助力人数' + JSON.stringify(res))
										needPerson = res.obj.activityHelpVoList.length
										res.obj.activityHelpVoList.forEach(function (item, i) {
											$('.portrict div').append('<img class="img' + i + '" src="' + (item.avatar ? item.avatar : '../images/award/header_t.png') + '">');
											$(".perRatio").html(res.obj.activityHelpVoList.length + "/3");

										})
										if (res.obj.activityHelpVoList.length < 3) {
											if (res.obj.activityHelpVoList.length == 1) {
												$(".portrict img").after('<img src="../images/award/wenhaotouxiang_big.png"><img src="../images/award/wenhaotouxiang_big.png">');
											}
											if (res.obj.activityHelpVoList.length == 2) {
												// $(".portrict img").after('<img src="../images/award/wenhaotouxiang_big.png">');
												$('.portrict .img1').after('<img src="../images/award/wenhaotouxiang_big.png">');
											}

										}

										if (res.obj.activityHelpVoList.length >= 3) {
											$(".btnGray").css("backgroundColor", "#ccc");
											$(".btnGray").html("感谢您的参与");
											$(".leavePerson").html("0");
											$('.zhuliBtn .zhuliBtnIn').css("display", "none");
											$('.zhuliBtn .btnGray').css("display", "block");
										} else {
											$(".leavePerson").html(3 - res.obj.activityHelpVoList.length);
										}
									}
								}
								/*判断用户是否已经助力开团*/
								// alert(isBind)
								var isktdatasGray = {
									// token: 'e16c3c89852fd4b759becaf47f319033',//userinfo.token 476230e27386384bb5330f9cc96eaaaa 
									token: token,//userinfo.token 476230e27386384bb5330f9cc96eaaaa 
									loginType: 51,//userinfo.loginType 50-本地会员,51-第三方微信登录,52-第三方QQ登录
								}
								/* var urlIsHelp = url + "/api/activity/help/isHelp";
								post(urlIsHelp, isktdatasGray, sucIsHelp, true, type, dataType);
								function sucIsHelp(data) {
									alert('是否助力:' + JSON.stringify(data));
									if (data.code == 200) {
										// alert('是否助力:' + JSON.stringify(data));
										// whether4('<div class="title">很遗憾！您与‘维达Emoji限量版手帕纸’活动仅差一个手指的距离</div>','我知道了')
										if (data.obj.isHelp == 0) {
											// alert("没有助力")
											// whether("<img src='../images/activity/celebrate.png'/><div class='titleH'>助力成功</div><div class='title'>恭喜您也获得手帕纸一条，仅需<span class='numP'>2</span>位好友助力就能免费邮寄到家啦！</div>", "我知道了")
											// $(".iKnow").on("click", function () {
											// 	window.location.href = "reward.html";
											// })
		
										}
										if (data.obj.isHelp == 1) {
											// alert("已经助力")
											// whether4("<div class='titleH'></div><div class='title'>您已参加过活动助力，不能再继续助力啦</div>", "我知道了")
											$(".btnGray").css("backgroundColor", "#ccc");
											$(".btnGray").html("感谢您的参与");
											$(".leavePerson").html("0");
											$('.zhuliBtn .zhuliBtnIn').css("display", "none");
											$('.zhuliBtn .btnGray').css("display", "block");
										}
									}
								} */

								/* 判断用户能否助力 */
								$(".test1").html(JSON.stringify(zlListParams));
								var urlAbleHelp = url + "/api/activity/help/ableHelp";
								post(urlAbleHelp, zlListParams, sucAbleHelp, true, type, dataType);
								function sucAbleHelp(data) {
									// alert('能否助力:' + JSON.stringify(data));
									if (data.code == 200) {
										// whether4('<div class="title">很遗憾！您与‘维达Emoji限量版手帕纸’活动仅差一个手指的距离</div>','我知道了')
										if (data.obj.ableHelp == 0) {
										}
										if (data.obj.ableHelp == 1) {
											// alert("自己助力")
											// whether4("<div class='titleH'></div><div class='title'>您已参加过活动助力，不能再继续助力啦</div>", "我知道了")
											$('.zhuliBtn .zhuliBtnIn').css("display", "none");
											$('.zhuliBtn .btnGray').css("display", "block");
											$(".btnGray").css("backgroundColor", "#ccc");
											$(".btnGray").html("感谢您的参与");
											// $(".leavePerson").html("0");
										}
										//老会员按钮置灰和弹窗
										if (data.obj.ableHelp == 1 && data.obj.reason == 'oldMember') {
											whether4("<div class='titleH'></div><div class='title'>" + data.msg + "</div>", "我知道了")
										}
									}
								}
								// console.log(isHelpBtn)
								var isOldMemeber = {}
								var isBind = localStorage.getItem('isbind');
								// isOldMemeber.mobile = 15501321445
								// alert(localStorage.getItem("userinfo"))
								var userinfoTemp = JSON.parse(localStorage.getItem("userinfo"));
								if (userinfoTemp.memberVo != undefined && userinfoTemp != null && userinfoTemp != '') {
									if (userinfoTemp.memberVo.mobile !== undefined) {
										isOldMemeber.mobile = userinfoTemp.memberVo.mobile;
									}
								}
								/* 点击助力帮他一把 */
								$('.zhuliBtnIn').on('click', function () {
									// isHelpBtn = true;
									if (isBind == 'false') {
										window.location.href = './bindTelN.html';
									}
									else {
										/* 助力并开团 */
										var urlHelpHand = url + "/api/activity/help/helpHand";
										post(urlHelpHand, zlListParams, sucHelpHand, true, type, dataType);
										function sucHelpHand(data) {
											alert('助力并开团' + JSON.stringify(data))
											if (data.code == 200) {
												// alert('助力一次:' + JSON.stringify(data))
												isopenPage = 1
												// whether('<img src="../images/activity/celebrate.png"/><div class="titleH">助力成功</div><div class="title">恭喜您也获得手帕纸一条，仅需<span class="numP">' + needPerson + '</span>位好友助力就能免费邮寄到家啦！</div>', "我要参与")
												if (data.obj) {
													initiatorId = data.obj //新开团id
													whether('<img src="../images/activity/celebrate.png"/><div class="titleH">助力成功</div><div class="title">恭喜您也获得手帕纸一条，仅需<span class="numP">2</span>位好友助力就能免费邮寄到家啦！</div>', "我要参与")
												} else {
													// isopenPage = 0
													whether('<div class="titleH">助力成功</div><div class="title">' + data.msg + '</div>', "我知道了")
												}
												$(".iKnow").on("click", function () {

													// alert('助力跳奖励'+ initiatorId)
													window.location.href = './reward.html?isopenPage=' + isopenPage + '&openGroupId=' + initiatorId + '&token=' + tokenPass + '&spreadId=' + spreadId
												})
											}

										}
									}
								})

							}
						} else if (code != 200) {
							alert(data.msg)

						}
					}
					function errWxlogin(data) {
						alert('登录失败')
					}
				}
				else {
					alert('授权不成功');
					// window.location.href = loUrl
				}
			}
		})
		/*分享时的点击我知道了或边框隐藏分享指示图片*/
		function closeModel() {
			$('.homeShare').hide();
		}
		//获取地址栏或变量的信息 如'?type=1' 则getParam('type'); 返回1;获取herf上的参数
		function getParam(str, search) {
			// alert(str);
			var query = search || window.location.href;
			splits = query.split(/\?|#|&/);
			for (var i = 0; i < splits.length; i++) {
				var equal = splits[i].split("=");
				if (equal[0] == str) return equal[1];
			}
			return undefined;
		}
		/*判断二次分享返回的展示*/
		var againId = window.location.href.split('againId=')[1];
		console.log('againId是' + againId);
		if (againId == 1) {
			$('.homeShare').show();
		}
	</script>

</html>